/**
 * \file saxdelegatesT.hh   (C) 2011 Andrew Page
 *  
 * Template impelementation file for tag delegates
 */

#include "ObjectSAXParser.hh"

namespace objectsaxparser {


template <class T>
StartDelegate<T>::StartDelegate(T *delegate, delegate_method method)
: delegate(delegate),
    method(method)
{
}


template <class T>
void StartDelegate<T>::tagStart(const string& tag)
{
    (delegate->*method)(tag) ;
}


template<class T>
StartDelegate<T>::StartDelegate(const StartDelegate<T>& copy)
: delegate(copy.delegate),
    method(copy.method)
{
}



template<class T>
EndDelegate<T>::EndDelegate(T *delegate, delegate_method method)
: delegate(delegate),
  method(method)
{
}

template<class T>
EndDelegate<T>::EndDelegate(const EndDelegate<T>& copy)
: delegate(copy.delegate),
   method(copy.method)
{

}

template<class T>
void EndDelegate<T>::tagEnd(const string& tag, const string &data, const attrDict& attrs)
{
    (delegate->*method)(tag, data, attrs) ;
}

}
